<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    footer {
      position: fixed;
      width: 100%;
      height: 60px;
      bottom: 0;
      left: 0;
      border-top: 1px solid #000;
      display: flex;
    }
    .footer-item {
      /* 子元素的宽度重新分配 */
      flex: 1; 
      /* 子元素的高度不需要设置，因为align-items的默认值stretch，所以子元素的高度和父元素一样 */
      /* 需要做弹性盒的嵌套 */
      display: flex;
      /* 设置方向是从上往下 */
      flex-direction: column;
      /* 上下左右居中 */
      justify-content: center;
      align-items: center;
    }
    .img {
      width: 20px;
      height: 20px;
      border: 1px solid #000;
      margin-bottom: 5px;
    }


    main {
      width: 100%;
      height: 200px;
      background-color: aquamarine;
      /* 溢出添加滚动条 */
      overflow: scroll;
    }
    .list-wrap {
      height: 100%;
      display: inline-flex;
    }
    .list-item {
      width: 100px;
      height: 200px;
      background-color: lightcoral;
      margin-right: 20px;
      /* flex-shrink: 0;让子元素不被挤压 */
      flex-shrink: 0;
    }
  </style>
</head>
<body>
  <main>
    <!-- 需要一个列表的容器，列表的容器在main里面进行滚动 -->
    <div class="list-wrap">
      <div class="list-item"></div>
      <div class="list-item"></div>
      <div class="list-item"></div>
      <div class="list-item"></div>
      <div class="list-item"></div>
      <div class="list-item"></div>
      <div class="list-item"></div>
    </div>
  </main>



  <footer>
    <div class="footer-item">
      <section class="img"></section>
      <span>文字</span>
    </div>
    <div class="footer-item">
      <section class="img"></section>
      <span>文字</span>
    </div>
    <div class="footer-item">
      <section class="img"></section>
      <span>文字</span>
    </div>
    <div class="footer-item">
      <section class="img"></section>
      <span>文字</span>
    </div>
  </footer>
</body>
</html>